package com.twu.biblioteca;

import java.util.ArrayList;


public class BookListBuilder {
   String avoidBookStatus;
   ArrayList<Book> targetList;

    public BookListBuilder(String avoidBookStatus, ArrayList<Book> targetList) {
        this.avoidBookStatus = avoidBookStatus;
        this.targetList = targetList;
    }

    public String buildString() {
        StringBuilder sb = new StringBuilder();
        for (Book book : targetList) {
            if (!avoidBookStatus.equals(book.getStatus())) {
                sb.append(book.number + "." + book.title);
                sb.append("\n");
            }
        }
        return sb.toString();
    }
}


